package mao.thinkinjava.concurency.daemon;
import java.util.concurrent.TimeUnit;


/**
 * finally will always run
 */
public class ADeamon implements Runnable{

    @Override
    public void run() {
        try{
            System.out.println("a daemon thread start");
            TimeUnit.MILLISECONDS.sleep(10000);
            System.out.println("before return ");
            return;
        }catch (Exception e){
            e.printStackTrace();
        }finally {
            System.out.println("this will always run");
        }
    }
}
